﻿@using GameSchool.HtmlHelpers
@model GameSchool.ViewModels.Project.CreateViewModel
@{
    ViewBag.Title = "Skrá nýtt verkefni";
}
<h2>
    Skrá nýtt verkefni</h2>
<p>
    Notaðu formið hér að neðan til þess að skrá nýtt verkefni.
</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm(htmlAttributes: new { @class = "form-horizontal" }))
{
    @Html.ValidationSummary(true, "Ekki tókst að skrá nýtt verkefni. Vinsamlegast leiðréttu villurnar og reyndu aftur.")
    <div>
        <fieldset>
            <legend>Skrá verkefni</legend>
            <div class="control-group">
                @Html.LabelFor(m => m.project.Name, new { @class = "control-label" }, "Nafn")
                <div class="controls">
                    @Html.TextBoxFor(m => m.project.Name, new { @class = "input-xlarge" })
                    @Html.ValidationMessageFor(m => m.project.Name)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.project.Description, new { @class = "control-label" }, "Lýsing")
                <div class="controls">
                    @Html.TextAreaFor(m => m.project.Description, new { @class = "input-xlarge" })
                    @Html.ValidationMessageFor(m => m.project.Description)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.project.HoursToFinish, new { @class = "control-label" }, "Klukkutímar í skil")
                <div class="controls">
                    @Html.TextBoxFor(m => m.project.HoursToFinish, new { @class = "input-small", type = "number" })
                    @Html.ValidationMessageFor(m => m.project.HoursToFinish)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.project.GradePercentage, new { @class = "control-label" }, "Vægi")
                <div class="controls">
                    @Html.TextBoxFor(m => m.project.GradePercentage, new { @class = "input-small", type = "number" })
                    @Html.ValidationMessageFor(m => m.project.GradePercentage)
                </div>
            </div>
            <div class="form-actions">
                <input type="submit" class="btn btn-primary" value="Skrá verkefni" />
                <a href="@Url.Action("List", new { id = Model.course.CourseID })" class="btn">
                    Til baka í verkefnalista</a>
            </div>
        </fieldset>
    </div>
}
